﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frame.Lib.Core.Tree;
using Cms.Entity.Menu;
using Cms.DAL.Menu;
using Cms.DAL;
using Cms.BLL.Article;


namespace Cms.BLL.Menu
{

    public class MenuBO : TreeBO<MenuInfo>
    {
        private MenuDAL _menu;

        public MenuBO()
            : base(CTableName.Menu)
        {
            _menu = new MenuDAL();
        }


        public override void Delete(IEnumerable<int> ids)
        {
            ArticleBO article = new ArticleBO();

            article.DeleteByMenuIDs(ids);
            base.Delete(ids);
        }

        //public List<MenuInfo> GetListByCompany(int companyID)
        //{
        //    List<MenuInfo> list = _menu.GetListByCompany(companyID);
        //    return list;
        //}

        //public int GetMaxCode()
        //{
        //    return _menu.GetMaxCode();
        //}

        //public bool HasMenus(int companyID)
        //{
        //    bool flag = _menu.HasMenus(companyID);
        //    return flag;
        //}

        //public void DeleteByCompany(IEnumerable<int> companyIDs)
        //{
        //    _menu.DeleteByCompany(companyIDs);
        //}

        public MenuInfo GetInfoByCode(int menuCode)
        {
            MenuInfo info = _menu.GetInfoByCode(menuCode);
            return info;
        }
    }
}
